import type { ErrorInfoModalConfig } from "@/models/modalModel"
import { Button, Modal } from "antd"

interface Props {
  config: ErrorInfoModalConfig
  onCancel: () => void
}

const ErrorInfoModal: React.FC<Props> = ({ config, onCancel }) => {
  return (
    <Modal
      title={config.title}
      open={config.visible}
      width={window.screen.availWidth - 700}
      closable={true}
      onCancel={onCancel}
      footer={[
        <Button key="1" onClick={onCancel}>
          关闭提示框
        </Button>
      ]}
    >
      <p>{config.content}</p>
    </Modal>
  )
}

export default ErrorInfoModal
